package com.star.dao;

import com.star.pojo.Comment;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * com.star.dao
 *
 * @Description: 评论类接口
 * @Date: 2020-08-10 19:45
 * @Author: LENSTAR
 * @URL: http://123.57.161.114:9000/
 */
public interface CommentMapper {


    //查询父级评论
    List<Comment> findByBlogIdParentIdNull(@Param("blogId") Long blogId, @Param("blogParentId") Long blogParentId);

    //查询一级回复
    List<Comment> findByBlogIdParentIdNotNull(@Param("blogId") Long blogId, @Param("id") Long id);

    //查询二级回复
    List<Comment> findByBlogIdAndReplayId(@Param("blogId") Long blogId, @Param("childId") Long childId);

    //添加一个评论
    int saveComment(Comment comment);

    //删除评论
    void deleteComment(Long id);
}
